﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace Eixos3D
{
    class GameObjectManager
    {

        public static List<GameObject> objects = new List<GameObject>();
        float scale_incre = 1.01f;
        float scale_total = 0.1f;
        bool crescendo = true;


        public GameObjectManager()
        {

        }
     

        public void Update(KeyboardState keyboard)
        {
            for (int i = 0; i < objects.Count; i++)
            {
                objects[i].rotationMatrix *= Matrix.CreateRotationX(0.01f) * Matrix.CreateRotationY(0.01f);

                
                if (scale_total > 10.0f)
                    crescendo = false;
                else if (scale_total < 0.1f)
                    crescendo = true;


                if (!crescendo)
                {
                    scale_total -= 0.1f;
                    scale_incre = 0.99f;
                }
                else
                {
                    scale_total += 0.1f;
                    scale_incre = 1.01f;
                }
                   
                objects[i].scaleMatrix *= Matrix.CreateScale(scale_incre);

                
            }
        }

    }
}

